<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>

<head>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta charset='utf-8'>
<meta http-equiv="Cache-Control" content="no-siteapp" />
<title>艺术家入驻</title>
<meta name="viewport"
	content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="Cache-Control" content="no-siteapp">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/css/page.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/css/base.css" />
<script src="${pageContext.request.contextPath }/js/jquery-1.11.0.js"
	type="text/javascript"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery.SuperSlide.2.1.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery.citys.js"></script>
<style type="text/css">
form p{
	font-size:18px;
}
form img{
	margin-top:40px;
}
#btn_img {
	margin-left: 38%;
	margin-top: 10px;
	margin-bottom: 10px;
}
form input:last-child{
	margin-left:60%;
	width:80px;
	height:30px;
}
.img-box {
	height: 400px;
}
</style>
</head>
<body>
	<jsp:include page="header.jsp" />
	<!--navbar star-->
		<div class="navbar clearfix">
			<div class="content clearfix">
				<ul>
					<li class="cur"><a href="${pageContext.request.contextPath }/index.jsp">首页</a></li>
					<li><a href="${pageContext.request.contextPath }/special.jsp">专场</a></li>
					<li><a href="${pageContext.request.contextPath }/mall.jsp">商城</a></li>
					<li><a href="${pageContext.request.contextPath }/artist.jsp">艺术家</a></li>
				</ul>
			</div>
		</div>
		<!--navbar end-->
	<!--settled star-->
	<div class="homepage clearfix">
		<div class="content clearfix">
			<div class="media-right clearfix box-s img-box">

				<form method="post" action="${pageContext.request.contextPath }/fileUploadServlet"
					enctype="multipart/form-data">
					<p>个人头像</p>
					<img src="img/tu.png" width="150px;" height="132px;" id="img_header">
					<input type="file" name="uploadFile" id="btn_img" /> 
					<input type="submit" value="上传" />
				</form>
			</div>
		</div>
	</div>

	<jsp:include page="footer.jsp" />
</body>
<script src="${pageContext.request.contextPath }/js/other.js"
	type="text/javascript"></script>
<script type="text/javascript">
 var fileInput = document.getElementById("btn_img"), previewImg = document
			.getElementById("img_header");
	fileInput.addEventListener('change', function() {
		var file = this.files[0];
		var reader = new FileReader();
		// 监听reader对象的的onload事件，当图片加载完成时，把base64编码賦值给预览图片
		reader.addEventListener("load", function() {
			previewImg.src = reader.result;
		}, false);
		// 调用reader.readAsDataURL()方法，把图片转成base64
		reader.readAsDataURL(file);
	}, false); 
</script>
</html>
